package chenxi.pool;

import org.apache.commons.pool2.impl.GenericObjectPool;

import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;

/**
 * @author bowen
 */
public class ReaderUtilClient {

    public static void main(String[] args) {
        ReaderUtil readerUtil = new ReaderUtil(new GenericObjectPool<>(new StringBufferFactory()));
        Reader reader = new StringReader("foo");
        try {

            System.out.println(readerUtil.readToString(reader));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
